WDV221 Intro Javascript

Project 3 - Calculations and Textfields - In Class Exercises


Please complete the following exercises on this page. When complete post the page to your WDV221 folder on the server. Make a link in your WDV221 Intro Javascript page for this assignment. Contact your instructor and demonstrate that you have completed the assignment.

Using Blackboard complete the In Class Exercise Assignment. Download your Homework project and being working on it with your remaining time.

For each exercise use a comment line to put the Exercise number within the script. Also place a short description of what the script is doing.


Part I

1. Define and initialize three variables called v1, v2 and v3 with the following values: 3, 4, "8.3". They should have global scope.

2. Display the result of v1 + v2 using document.write. place results here:

3. Display the result of v2 + v3 using document.write.place results here:

4. Dispaly the result of v1 * v2 using document.write. place results here:

5. Display the result of v2 * v3 using document.write. place results here:

Part II

6. Display the result of v1 + v3 using parseInt( ) on v3 using document.write. place results here:

7. Display the result of v1 + v3 using parseFloat( ) on v3 using document.write. place results here:

Part III

For each of the following exercises create a function what will be activated by the button.

Enter a number for value1:

Enter a number for value 2:

8. Display the value you entered for value1:

9. Dislplay the value you entered for value2:

10. Display the value of value1 * value2:

11. Display the results of value1 + value2 in the following textfield.

12. Display the results of value1 + value2 in the following textfield. Use parseInt( ) or parseFloat( ).